//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#include <QtWidgets/QApplication>
#include "editor/qttoosgkeycodetranslator.h"
#include "editor/mainview.h"
#include <stdio.h>
#include <stdlib.h>
//
/*
 * this is not needed? (or use qInstallMessageHandler)
void myMessageOutput(QtMsgType type, const char *msg)
 {
     switch (type) {
     case QtDebugMsg:
         fprintf(stdout, "Debug: %s\n", msg);
         break;
     case QtWarningMsg:
         fprintf(stdout, "Warning: %s\n", msg);
         break;
     case QtCriticalMsg:
         fprintf(stdout, "Critical: %s\n", msg);
         break;
     case QtFatalMsg:
         fprintf(stdout, "Fatal: %s\n", msg);
         abort();
     }
     fflush(stdout);
 }
*/

int main(int argc, char *argv[])
{
   //obsolete in Qt5, why was this needed?
   //qInstallMsgHandler(myMessageOutput);
   // initialize resources, if needed
   // Q_INIT_RESOURCE(resfile);

   QtToOsgKeyCodeTranslator::initialize();
   
   QApplication app(argc, argv);
   app.setApplicationName("FireworksCreator");
   app.setApplicationVersion("0");

   //MainWindow mainWin;
   //Framework::init(&mainWin);
   //mainWin.show();
   MainView main_view;
   main_view.show();

   int rval = app.exec();

   //Framework::destruct();
   QtToOsgKeyCodeTranslator::uninitialize();

   return rval;
}
